package org.grow.enter.controller;



import org.grow.enter.entity.Person;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: xwg
 * @CreateDate: 2021/9/7
 */

@Controller
public class CommonController {
    @GetMapping("/show")
    @ResponseBody
    public String showTime(){
        return "当前时间:"+System.currentTimeMillis();
    }
    @GetMapping("/showPerson")
    @ResponseBody
    public Person showPerson(){
        Person person = new Person();
//        alt+enter
        person.setUsername("zhangsan");
        person.setAge(12);
        person.setSex(true);
        Person lisi = new Person("lisi", 12, false);
        return person;
    }
    @PostMapping("/insertPerson")
    @ResponseBody
    public Boolean insertPerson(@RequestBody Person person){
        System.out.println(person);
        return true;
    }



}
